#!/usr/bin/env node

const Radio = require('./04-radio');

const station = {
    freq: '101.1',
    name: 'Rock FM'
};

const radio = new Radio(station);

// 处理 Radio 对象的 play 事件
radio.on('play', function(station) {
    console.log(`Radio is playing on ${station.freq} - ${station.name}`);
  });
  
  // 处理 Radio 对象的 stop 事件
  radio.on('stop', function(station) {
    console.log(`Radio stopped playing on ${station.freq} - ${station.name}`);
  });